import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        san();
        chang();
        zheng();
    }
    public static void san(){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入底边长");
        double a= scanner.nextDouble();
        System.out.println("请输入高");
        double b= scanner.nextDouble();
        double S1=a*b/2;
        System.out.println("三角形面积为:"+S1);
    }
    public static void chang(){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入长");
        double c= scanner.nextDouble();
        System.out.println("请输入宽");
        double d= scanner.nextDouble();
        double S2=c*d;
        System.out.println("长方形面积为:"+S2);
    }
    public static void zheng(){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入边长");
        double f= scanner.nextDouble();
         double S3=f*f;
        System.out.println("正方形面积为:"+S3);
    }
}
